package com.xinya.wanandroidclient.ui.tologin.login

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.xinya.wanandroidclient.base.BaseViewModel
import com.xinya.wanandroidclient.bean.LoginBean

/**
 *
 * @ClassName:      LoginViewModel$
 * @Description:    java类作用描述
 * @Author:         xinya
 * @CreateDate:     2021/3/9$ 17:19$
 * @UpdateRemark:   更新内容
 * @Version:        1.0
 */
class LoginViewModel : BaseViewModel(){

    private val repo by lazy {
        LoginRepo(viewModelScope)
    }

    val loginLiveData by lazy {
        MutableLiveData<LoginBean>()
    }

    fun login(username: String, password: String) {
        repo.login(username, password, loginLiveData,errorLiveData)
    }
}